import { defineStore } from 'pinia'
import { ref, reactive, computed } from 'vue'
export const useStore = defineStore('store', () => {
	let num = ref(0)
	let detail = ref()
	let flag = ref(true)
	const changeFlag = () => {
		flag.value = !flag.value
	}
	const detailsave = (data) => {
		detail.value = data
	}
	return { num, detail, detailsave, flag, changeFlag }
}, {
	persist: {
		enable: true,
		key: 'store',
		storage: window.localStorage,
		paths: ['num', 'flag']
	}
})